home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 4.3 KB | 134 lines | [TEXT/MPS ] |
- // UTabBehaviors.h
- // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
-
- #ifndef __UTABBEHAVIORS__
- #define __UTABBEHAVIORS__
-
- // MacApp
-
- #ifndef __UBEHAVIOR__
- #include "UBehavior.h"
- #endif
-
- //----------------------------------------------------------------------------------------
- // Forward and external class declarations.
- //----------------------------------------------------------------------------------------
-
- class TView;
-
- //----------------------------------------------------------------------------------------
- // TTabber
- //----------------------------------------------------------------------------------------
-
- // An abstract parent class for tabbing behaviors which intercept the Tab key event
- // and find the next view which wishes to become the target
-
- const IDType kTabBehavior = 'tabb'; // Behavior identifier
-
- class TTabber : public TBehavior
- {
- MA_DECLARE_CLASS;
-
- public:
- Boolean fRecursive; // True if the search should include the entire view hierarchy
- // false if it should be limited to immediate subviews
- Boolean fFoundCurrent; // Set to true when the current target has been found
- TView* fFirst; // Save the first potential target (to do wraparound)
- TView* fNext; // The view which becomes the new target.
-
- //------------------------------------------------------------------------------------
- // Constructor
- //------------------------------------------------------------------------------------
-
- TTabber();
- // Constructor
- virtual ~TTabber();
- // Destructor
-
- void ITabber(Boolean recursive);
-
- //------------------------------------------------------------------------------------
- // Stream I/O protocol support.
- //------------------------------------------------------------------------------------
-
- virtual void ReadFrom(TStream* aStream);
-
- virtual void WriteTo(TStream* aStream);
-
- //------------------------------------------------------------------------------------
- // Event handling.
- //------------------------------------------------------------------------------------
-
- virtual void DoKeyEvent(TToolboxEvent* event);
- virtual void Tab(Boolean tabBackward);
- virtual void Reset();
- virtual void FindSubViewTargets(TView* parent,
- Boolean tabBackward);
- virtual void FindTargets(Boolean tabBackward);
-
- virtual IDType GetStandardSignature();
- // Return the standard signature for this class
- };
-
- //----------------------------------------------------------------------------------------
- // TMultiWindowTabber
- //----------------------------------------------------------------------------------------
-
- // Attached to the application object. Handles tabbing across multiple active
- // windows (i.e. when windoids are present)
-
- class TMultiWindowTabber : public TTabber
- {
- MA_DECLARE_CLASS;
-
- public:
- //------------------------------------------------------------------------------------
- // Constructor
- //------------------------------------------------------------------------------------
-
- TMultiWindowTabber();
- // Empty constructor to satisfy compiler.
- virtual ~TMultiWindowTabber();
- // Destructor
-
- void IMultiWindowTabber(Boolean recursive);
-
- //------------------------------------------------------------------------------------
- // Event handling.
- //------------------------------------------------------------------------------------
-
- virtual void FindTargets(Boolean tabBackward); // Override
- };
-
- //----------------------------------------------------------------------------------------
- // TViewTabber
- //----------------------------------------------------------------------------------------
-
- // Can be attached to any view to intercept the Tab key before it gets to the
- // MultiWindowTabber in the application
-
- class TViewTabber : public TTabber
- {
- MA_DECLARE_CLASS;
-
- public:
- //------------------------------------------------------------------------------------
- // Constructor
- //------------------------------------------------------------------------------------
-
- TViewTabber();
- // Empty constructor to satisfy compiler.
- virtual ~TViewTabber();
- // Destructor
-
- void IViewTabber(Boolean recursive);
-
- //------------------------------------------------------------------------------------
- // Event handling.
- //------------------------------------------------------------------------------------
-
- virtual void FindTargets(Boolean tabBackward); // Override
- };
-
- #endif
-